# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-ndg-httpsclient
_pkgname=ndg_httpsclient
pkgver=0.5.1
pkgrel=8
pkgdesc='Provides enhanced HTTPS support for httplib and urllib2 using PyOpenSSL.'
url='https://pypi.org/project/ndg-httpsclient/#files'
arch=('any')
license=('BSD')
depends=('python2' 'python2-pyopenssl' 'python2-pyasn1')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b2b4c1b1df87ea1a94811b9ae831e7bf32af27258f487fd5ec319e0e6e0d79dfdb1f7bfadaf397d0693a8a7f0720df170a7fc946aaf10c82e3957ac5464f672e')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/ndg_httpclient" "$pkgdir/usr/bin/ndg_httpclient2"
}

